#ifndef ROTATIONDETECTOR_H
#define ROTATIONDETECTOR_H

#include "Logger.h"
#include "MotionDetector.h"
#include <opencv2/core.hpp>
#include <opencv2/opencv.hpp>
#include <opencv2/video/tracking.hpp>

class RotationDetector : public MotionDetector
{
  public:
    RotationDetector(Logger &logger);
    bool detect(const std::vector<float> &yaw_data, MotionStatus &out_status) override;

  protected:
    // 用于估计 yaw 的 Kalman 滤波器（状态维度为位置和速度）
    cv::KalmanFilter yaw_kf;

    float yaw_jump_threshold = 50.0f;
    int jump_count_threshold = 1;

    Logger &logger;
};

#endif // ROTATIONDETECTOR_H